package com.sunshine.sunnyannotation.controller;

import com.sunshine.sunnyannotation.model.User;
import com.sunshine.sunnyannotation.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: sanglei
 * @date: 2018-11-01 9:41
 * @description:
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;
    @PostMapping(value = "query")
    public User query(@RequestParam("id") long id){
        User user = userService.query(id);
        return user;
    }
}
